package com.czkt.springboot_mybatis_test.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.czkt.springboot_mybatis_test.entity.SysRight;
import com.czkt.springboot_mybatis_test.entity.SysRole;
import com.czkt.springboot_mybatis_test.entity.vo.RoleRight;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2024-06-18
 */
@Mapper
public interface SysRightMapper extends BaseMapper<SysRight> {
    @Select("select * from sys_right")
    List<SysRight> selectRoleRight();

    @Select("insert into sys_role ( role_name, role_desc, role_flag) values (#{roleName},#{roleDesc},#{roleFlag});")
    void toInsertRoleRight(SysRole sysRole);

    @Select("select * from sys_role where role_id in(select max(crm.sys_role.role_id) from crm.sys_role);")
    SysRole selectRoleId();
}
